<template lang="">
  <div class="_box-scroll _over-scroll-hidden _wrapper-y">
    <span class="_font-reminder _font-mini" @click="list()">刷新</span>
    <el-table :data="pageData.records" stripe border v-loading="loading">
      <el-table-column prop="created_date" label="创建时间">
        <template #default="scope">
          {{ $tool.dateStr(scope.row.created_date) }}
        </template>
      </el-table-column>
      <el-table-column prop="cmd" label="指令内容"></el-table-column>
      <el-table-column prop="status" label="状态">
        <template #default="scope">
          {{ scope.row.status ? "成功" : "失败" }}
        </template>
      </el-table-column>
      <el-table-column prop="type" label="指令类型"></el-table-column>
      <el-table-column prop="opt" label="操作类型"></el-table-column>
      <el-table-column prop="num" label="推送次数"></el-table-column>
    </el-table>
  </div>
</template>
<script>
import toolAction from "@/tool/http/tool-action";

let thingsDeviceCmd = toolAction.init("things_device_cmd");

export default {
  data() {
    return {
      pageData: {},
      loading: false,
    };
  },
  mounted() {
    this.list();
  },
  methods: {
    list() {
      this.loading = true;
      thingsDeviceCmd
        .page({
          rules: {
            device_code__eq: this.comCode,
          },
        })
        .then((res) => {
          this.pageData = res;
          this.loading = false;
        });
    },
  },
};
</script>
<style lang=""></style>
